How to return error code when using tee in bash

welcome to shbcf.ru